Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

101 startup indicator #105

Merged
merged 3 commits into from
Dec 26, 2023
Merged

101 startup indicator #105

merged 3 commits into from
Dec 26, 2023

Conversation

thearyadev
Copy link
Owner

This PR addresses a few problems.

  1. First Hit Load Time
    The backend caches the data. This is because it is expensive to compute. (Currently, about 6 seconds). The backend uses a built-in lru_cache which caches the result of a input for a function once it is run. The endpoint functions run these functions, and are generally the first-caller so they do the computing.

This makes it so the first hit needs to wait 6 seconds (plus network/rendering delay) to see the page.

The caching phase has been moved to the fastapi startup event.

  1. Ambiguous Startup Time
    it is someitmes confusing for the developer to recognize if the backend is doing anything as it is run.

Console output has been added to clarify what is running and when.
A time tracker has also been added to easily monitor the startup time.

@thearyadev thearyadev linked an issue Dec 26, 2023 that may be closed by this pull request
@thearyadev thearyadev merged commit 2270e7e into main Dec 26, 2023
6 checks passed
thearyadev added a commit that referenced this pull request Jan 19, 2024
* add server dependency `rich`

* add startup sequence

* add trends link to navbar
@thearyadev thearyadev deleted the 101-startup-indicator branch January 23, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

startup indicator
1 participant